﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Timers;
using System.Windows.Threading;

namespace Player
{
    public partial class MainWindow : Window
    {


        
        DispatcherTimer hourTimer;

        public MainWindow()
        {
            InitializeComponent();

             hourTimer = new DispatcherTimer();
             hourTimer.Interval = new TimeSpan(0, 0, 1);
             hourTimer.Tick += new EventHandler(hourTimer_Tick);
        }

        private void btnPlay_Click(object sender, RoutedEventArgs e)
        {
            hourTimer.Start();
            Console.WriteLine("Timer Started");

        }

            




        public void hourTimer_Tick(object sender, EventArgs e)
        {
            hourSlider.Value += 1;
            lblTime.Content = hourSlider.Value;
     
            if (hourSlider.Value == 12)
            {
                hourSlider.Value = 0;
                
            }
        }

        private void btnPause_Click(object sender, RoutedEventArgs e)
        {
            hourTimer.Stop();
            Console.WriteLine("Timer Stopped");
        }
    }
}

    

